﻿public class Solution {
    public int IntegerBreak(int n)
    {
        if (n <= 2) return 1;
        int[] dp = new int[n+1];
        dp[0] = dp[1] = dp[2] = 1;

        for (int i = 3; i <= n; i++)
        {
            for (int j = 1; j <= i / 2; j++)
            {
                int temp = Math.Max(j * dp[i - j], j * (i - j));
                dp[i] = Math.Max(dp[i], temp);
            }
        }

        return dp[n];
    }

    public static void Main(string[] args)
    {
        int n = 10;
        Solution solution = new Solution();
        int res = solution.IntegerBreak(n);
        Console.WriteLine(res);
    }
}